﻿<%@ Page Language="C#" MasterPageFile="~/BabyAdminCP/Admin.master" AutoEventWireup="true" CodeFile="qlnhomtin.aspx.cs" Inherits="Admin_TinTuc_qlnhomtin"%>
<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HomePlaceHolder" Runat="Server">
<script type="text/javascript">
var gridMain = null;
window.onload = function() {
    try {
        //get target base control.
        gridMain = document.getElementById('<%= this.gridCatalog.ClientID %>');
    }
    catch (err) {
        gridMain = null;
    }
}
</script>
<script src="../../Scripts/QLTinTuc.js" type="text/javascript"></script>
<div class="hrm_header_placeholder">Quản lý Tin tức</div>
<div style="padding: 10px">
<asp:Panel ID="PanelAdd" Width="100%" GroupingText="Tìm kiếm thông tin" runat="server">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
    <tr><td colspan="8" height="10"></td></tr>
    <tr>
        <td width="20"></td>
        <td width="70" class="hrm_title_blue">Tiêu đề tin</td>
        <td width="7" class="hrm_title_blue">:</td>        
        <td width="220">
            <asp:TextBox ID="txtTieuDe" CssClass="hrm_textbox" Width="200px" MaxLength="100" runat="server"></asp:TextBox>
        </td>
        <td width="20"></td>
        <td width="70" class="hrm_title_blue">Nhóm tin</td>
        <td width="7" class="hrm_title_blue">:</td>        
        <td>
            <asp:DropDownList ID="cboNhomTin" CssClass="hrm_combobox" Width="205px" runat="server"></asp:DropDownList>
        </td>        
    </tr>        
    <tr><td colspan="8" height="8"></td></tr>    
    <tr>
        <td width="20"></td>
        <td width="70" class="hrm_title_blue"></td>
        <td width="7" class="hrm_title_blue"></td>        
        <td colspan="5">
            <asp:ImageButton ID="cmdTimKiem" ImageUrl="~/Images/tim.jpg" runat="server" onclick="cmdTimKiem_Click" />
            <asp:ImageButton ID="cmdTimLai" CausesValidation="false" ImageUrl="~/Images/timlai.jpg" runat="server" onclick="cmdTimLai_Click" />
        </td>
    </tr>
    <tr><td colspan="4" height="8"></td></tr>    
</table>    
</asp:Panel>
<asp:Panel ID="PanelList" Width="100%" GroupingText="Danh sách" Height="355" runat="server">
<table border="0" width="100%" cellpadding="0" cellspacing="0">    
    <tr>
        <td width="20"></td>
        <td style="padding-right:15px; padding-top:12px">
            <asp:GridView ID="gridCatalog" runat="server" DataKeyNames="Id" Width="100%" BackColor="White"
                OnRowDataBound = "gridCatalog_RowDataBound"
                EmptyDataText="<br><center>Không tồn tại dữ liệu</center><br>"
                BorderColor="#CCCCCC" AutoGenerateColumns="false" BorderStyle="Solid" BorderWidth="1px" CellPadding="3">
                <Columns>
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="STT" ItemStyle-Width="30">
                        <ItemTemplate>    
                            <asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>                                    
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="30">
                        <ItemTemplate>    
                            <asp:CheckBox ID="chkSelect" runat="server" />  
                            <asp:HiddenField ID="H_IdCatalog" runat="server" Value='<%# Eval("Id") %>' />                         
                            <asp:HiddenField ID="H_Image" runat="server" Value='<%# Eval("AnhDaiDien") %>' />                         
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="TieuDe" HeaderText="Tiêu đề tin"></asp:BoundField>
                    <asp:BoundField DataField="NhomTinTuc" HeaderText="Nhóm tin" ItemStyle-Width="140"></asp:BoundField>
                    <asp:BoundField DataField="TacGia" HeaderText="Tác giả" ItemStyle-Width="130"></asp:BoundField>
                    <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="Ngày cập nhật" ItemStyle-Width="90">
                        <ItemTemplate>
                            <asp:Label ID="LabelNgayCapNhat" runat="server" Text='<%# Convert.ToDateTime(Eval("NgayCapNhat")).ToString("dd/MM/yyyy")%>'></asp:Label>                               
                        </ItemTemplate>
                    </asp:TemplateField>                     
                </Columns>                  
                <RowStyle ForeColor="#000066" />
                <SelectedRowStyle BackColor="#dedfdf" Font-Bold="True" ForeColor="Gray" />
                <HeaderStyle BackColor="#006699" Font-Bold="True" HorizontalAlign="Left" ForeColor="White" />               
            </asp:GridView>
        </td>
    </tr>    
    <tr><td colspan="2" height="10">&nbsp;</td></tr>    
</table>    
</asp:Panel>
</div>
<asp:Panel ID="Panel2" CssClass="div_footer" BackColor="#d6e6f5" runat="server" Height="24px" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td>
            <asp:ImageButton ID="cmdTaoMoi" CausesValidation="false" ImageUrl="~/Images/taomoi.jpg" PostBackUrl="~/Admin/TinTuc/CNTinTuc.aspx" runat="server"/>
            <asp:ImageButton ID="cmdHieuChinh" CausesValidation="false" OnClientClick="return HieuChinh_TinTuc();" ImageUrl="~/Images/hieuchinh.jpg" runat="server" onclick="cmdHieuChinh_Click" />             
            <asp:ImageButton ID="cmdXoa" CausesValidation="false" OnClientClick="return Xoa_TinTuc();" ImageUrl="~/Images/xoa.jpg" runat="server" runat="server" onclick="cmdXoa_Click" />             
        </td>
        <td align="right">
            <cc1:Pager id="Pager1" runat="server" PreviousClause="" NextClause="" LastClause="" FirstClause="" PageClause="" OfClause="/" PageSize="10" OnCommand="Pager1_Command" ></cc1:pager>
        </td>
    </tr>
</table>
</asp:Panel> 
</asp:Content>

